package edu.pku.sei.sct.evaluation;

import edu.pku.sei.AMT.Rule;
import edu.pku.sei.ocl.evaluation.Context;
import edu.pku.sei.ocl.evaluation.Environment;

public class RuleContext extends Context {
	private Rule rule;
	

	public Rule getRule() {
		return rule;
	}

	public void setRule(Rule rule) {
		this.rule = rule;
	}

	public RuleContext(Environment env) {
		super(env);
	}
	
	public Context createCopy() {
		RuleContext tc = new RuleContext(this.getEnvironment());
		tc.setRule(this.getRule());
		return tc;
	}
	
	public boolean isIncludedBy(Context c) {
		if(c instanceof RuleContext) {
			RuleContext nc = (RuleContext)c;
			if(nc.getRule()!=this.getRule())
				return false;
		}
		
		return super.isIncludedBy(c);
	}

}
